# coding=utf-8
import maya.cmds as cmds
import maya.mel as mel
import core as timelimit

def ClothDisplay():


	clothlist = []
	listTransforms = cmds.ls(transforms=1)
	for i in cmds.ls( references=1 ):
		referencePath = cmds.referenceQuery(  i,filename=1)
		Namespace = cmds.referenceQuery( referencePath, namespace=True, shortName=True )
		for  Trans in listTransforms:
			if Namespace+":cloth_out" == Trans or Namespace+":N" == Trans:
				clothlist.append(Trans)
				
	#print(clothlist)\t   
	cmds.select(clothlist)

	listTransforms = cmds.ls("cloth")
	if len(listTransforms):
		cmds.editDisplayLayerMembers ("cloth" ,clothlist)
	else:
		cmds.createDisplayLayer (name ="cloth", number= 1 ,nr=1)
		cmds.setAttr ("cloth.displayType" ,1)
		cmds.setAttr ("cloth.color" ,13)


